/*
 * *
 *  * Created with IntelliJ RustRover.
 *  * Description:
 *  * Copyright Author: ZhenYi
 *  * DateTime: 2024/2/14 下午5:10
 */
mod login;
mod local;
mod reg;

use salvo::Router;
use crate::user::login::{login_admin, login_author, login_expert};
/// 普通用户路由
/// login/admin  管理员登录路由
/// login/author 作者登录路由
/// login/expert 专家登录路由
/// reg/register 注册路由
/// reg/send 发送验证码路由
/// reg/check 验证验证码路由
/// local 获取当前用户信息
pub fn user_route() ->Router{
    Router::new()
        .push(
            Router::with_path("login")
                .push(Router::with_path("admin").post(login_admin))
                .push(Router::with_path("author").post(login_author))
                .push(Router::with_path("expert").post(login_expert))
        )
        .push(
            Router::with_path("reg").post(reg::register)
                .push(Router::with_path("send").post(reg::verification_code))
                .push(Router::with_path("check").post(reg::verification_check))
        )
        .push(Router::with_path("local").post(local::local))
}
